functor HetContainer () :> HET_CONTAINER =
struct
  type t = exn

  fun 'a new () =
      let exception E of 'a
          val make = E
          val pred = fn E _ => true
                      | _ => false
          val peek = fn E x => SOME x
                      | _ => NONE
          fun debugPrint h =
              if pred h
              then print (String.concat [exnName h, "\n"])
              else print "it is NOT this container!\n"
      in {make = make,
          pred = pred,
          peek = peek}
      end
end
